package com.jiyun.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.mapper.ThComplaintMapper;
import com.jiyun.pojo.ThComplaint;
import com.jiyun.service.IThComplaintService;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author usian
 * @since 2022-10-26
 */
@Service
public class ThComplaintServiceImpl extends ServiceImpl<ThComplaintMapper, ThComplaint> implements IThComplaintService {

    @Override
    public boolean add(ThComplaint complaint) {
        //新增客诉时间为今天
        complaint.setComplaintTime(new Date());
        //新增客诉状态为待处理
        complaint.setComplaintResults(2);
        //门店为无申诉状态
        complaint.setAppeal(2);
        boolean save = this.save(complaint);
        if (save){
            return true;
        }
        return false;
    }
}
